package com.fancy.controller;


import com.fancy.pojo.category.Music;
import com.fancy.service.RankDownloadService;
import com.fancy.service.RankVisitService;
import com.fancy.service.RankcollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//@CrossOrigin
@RestController
public class RankController {
    @Autowired
    RankVisitService rankService;
    @Autowired
    RankDownloadService rankDownloadService;
    @Autowired
    RankcollectService rankcollectService;

    @RequestMapping("/rankvisitAllMusic")
    public String rankvisit(){
        return rankService.findAllMusic();
    }
    @RequestMapping("/rankdownloadAllMusic")
    public String rankdownload(){
        return rankDownloadService.rankdownload();
    }
    @RequestMapping("/redisrankdownloadAllMusic")
    public String redisrankdownload(){
        return rankDownloadService.redisdownload();
    }

    @RequestMapping("/rankcollectAllMusic")
    public String rankcollect(){
        return rankcollectService.rankcollect();
    }
    @RequestMapping("/ridesrankcollectAllMusic")
    public String ridesrankcollect(){
        return rankcollectService.rediscollect();
    }
    @RequestMapping("/ridesFindAllMusic")
    public String ridesFindAllMusic(){
        return rankService.ridesFindAllMusic();
    }
    @RequestMapping("/addvisit")
    public void addvisit(@RequestBody Music music){
        System.out.println(music);
        rankService.addvisit(music);
    }
    @RequestMapping("/FindAllMusic")
    public List<Music> FindAllMusic(){
        return rankService.findAllMusic1();
    }




}
